package com.keensense.vcm.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

import com.keensense.vcm.model.enums.OrderEnum;
import com.keensense.vcm.model.enums.SortEnum;

/**
 * @author lanjian
 * @date 2020/4/29 1:44 下午
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class PageModel {

    public PageModel(int no, int size, SortEnum sort, OrderEnum orderName) {
        this.size = size;
        this.no = no;
        this.sort = sort;
        this.orderName = orderName;
    }

    /**
     * 单页内显示记录数 取值范围为[0,1000] 分页查询总数，即no*size不能大于10000
     */
    @XmlElement
    private int size;

    /**
     * 单次查询页码编号为正整数
     */
    @XmlElement
    private int no;

    /**
     * 升序，asc/ASC，降序，desc/DESC
     */
    @XmlElement
    private SortEnum sort;

    /**
     * 排序名称，为字符串的枚举类型，time表示按时间排序，similarity表示按相似度排序。有图片时指定similarity或time；不传图片时指定time，当前按time只支持降序
     */
    @XmlElement
    private OrderEnum orderName;

    public void setSize(int size) {
        this.size = size;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public void setSort(SortEnum sort) {
        this.sort = sort;
    }

    public void setOrderName(OrderEnum orderName) {
        this.orderName = orderName;
    }

    public int getSize() {
        return size;
    }

    public int getNo() {
        return no;
    }

    public SortEnum getSort() {
        return sort;
    }

    public OrderEnum getOrderName() {
        return orderName;
    }

}
